package designpattern.strategy;

/**
 * TODO:类描述
 *
 * @className: Context
 * @packageName: designpattern.strategy
 * @author: Zhuhj
 * @version: V1.0
 * @date: 2021/4/18 18:53
 */
public class Context {
    private IStrategy iStrategy;
    public Context(IStrategy iStrategy){
        this.iStrategy= iStrategy;
    }
    public void fighting(){
        this.iStrategy.fighting();;
    }

    public static void main(String[] args) {
        Context c1 = new Context(new StrategyB());
        c1.fighting();
    }
}
